package org.domain.demo.entity;
// Generated Mar 8, 2012 9:45:17 AM by Hibernate Tools 3.4.0.CR1


import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.persistence.Version;

/**
 * Users generated by hbm2java
 */
@Entity
@Table(name="Users"
,schema="dbo"
,catalog="Demo"
		)
public class Users  implements java.io.Serializable {


	private int userId;
	private int version;
	private String principal;
	private String firstName;
	private String lastName;
	private String password;
	private String repeatPassword;
	private Date dateCreated;
	private int userIdCreated;
	private Date dateModified;
	private int userIdModified;

	public Users() {
	}


	public Users(int userId, String principal, String firstName, String lastName, Date dateCreated, int userIdCreated, Date dateModified, int userIdModified) {
		this.userId = userId;
		this.principal = principal;
		this.firstName = firstName;
		this.lastName = lastName;
		this.dateCreated = dateCreated;
		this.userIdCreated = userIdCreated;
		this.dateModified = dateModified;
		this.userIdModified = userIdModified;
	}
	public Users(int userId, String principal, String firstName, String lastName, String password, Date dateCreated, int userIdCreated, Date dateModified, int userIdModified) {
		this.userId = userId;
		this.principal = principal;
		this.firstName = firstName;
		this.lastName = lastName;
		this.password = password;
		this.dateCreated = dateCreated;
		this.userIdCreated = userIdCreated;
		this.dateModified = dateModified;
		this.userIdModified = userIdModified;
	}

	@Id 
	@Column(name="UserId", unique=true, nullable=false)
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public int getUserId() {
		return this.userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	@Version
	@Column(name="Version", nullable=false)
	public int getVersion() {
		return this.version;
	}

	public void setVersion(int version) {
		this.version = version;
	}


	@Column(name="Principal", nullable=false, length=30)
	public String getPrincipal() {
		return this.principal;
	}

	public void setPrincipal(String principal) {
		this.principal = principal;
	}


	@Column(name="FirstName", nullable=false, length=60)
	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}


	@Column(name="LastName", nullable=false, length=60)
	public String getLastName() {
		return this.lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}


	@Column(name="Password", length=128)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="DateCreated", nullable=false, length=23)
	public Date getDateCreated() {
		return this.dateCreated;
	}

	public void setDateCreated(Date dateCreated) {
		this.dateCreated = dateCreated;
	}


	@Column(name="UserId_Created", nullable=false)
	public int getUserIdCreated() {
		return this.userIdCreated;
	}

	public void setUserIdCreated(int userIdCreated) {
		this.userIdCreated = userIdCreated;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="DateModified", nullable=false, length=23)
	public Date getDateModified() {
		return this.dateModified;
	}

	public void setDateModified(Date dateModified) {
		this.dateModified = dateModified;
	}


	@Column(name="UserId_Modified", nullable=false)
	public int getUserIdModified() {
		return this.userIdModified;
	}

	public void setUserIdModified(int userIdModified) {
		this.userIdModified = userIdModified;
	}

	@Transient
	public String getFullName() {
		return (firstName==null?"":firstName)+" "+(lastName==null?"":lastName);
	}

	@Transient
	public String getRepeatPassword() {
		return repeatPassword;
	}

	public void setRepeatPassword(String repeatPassword) {
		this.repeatPassword = repeatPassword;
	}


}


